job compile(list inputs) {
  @{"gcc -c %s" % [(string)inputs[0],(string)inputs[0]]};
}

void main(list args) {
  list my_servers = [ [ "host"=>"clic.cs.columbia.edu", "user"=>"jordan", "pass"=>"pigasusR0Ck" ],
                   [ "host"=>"compute.cs.columbia.edu", "user"=>"jjr2119", "pass"=>"example" ] ];

  connect my_servers;
  
  list srcs = [[(file)"a.c"], [(file)"b.c"], [(file)"c.c"], [(file)"d.c"]];

  list output;
  int distcompile = push compile, null, srcs, output;
  wait distcompile;
  
  string ld = "gcc -o MyCoolProgram";
  
  for (int i = 0; i < length output; i = i + 1) {
    map out = (map)output[i];
    for (int j = 0; j < length out["files"]; j = j + 1) {
     ld = "%s %s/%s" % [ld, (string)out["root"], (string)(((list)out["files"])[j])];
    }
  }
  
  @{ld};
}